home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Tcl_Eval Tcl Command Language Library Tcl_Eval
-
-
-
- _________________________________________________________________
-
- NNAAMMEE
- Tcl_Eval - execute a Tcl command string
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ttccll..hh>>
-
- int
- TTccll__EEvvaall(_i_n_t_e_r_p, _c_m_d, _f_l_a_g_s, _t_e_r_m_P_t_r)
-
- AARRGGUUMMEENNTTSS
- Tcl_Interp *_i_n_t_e_r_p (in) Interpreter in which to
- execute the command.
- String result will be
- stored in _i_n_t_e_r_p-
- >_r_e_s_u_l_t.
-
- char *_c_m_d (in) Command (or sequence of
- commands) to execute.
-
- char _f_l_a_g_s (in) Either TTCCLL__BBRRAACCKKEETT__TTEERRMM
- or 0. If 0, then |
- TTccll__EEvvaall will process |
- commands from _c_m_d until |
- it reaches the null |
- character at the end of |
- the string; newlines |
- will be treated as com- |
- mand separators. If |
- TTCCLL__BBRRAACCKKEETT__TTEERRMM, then |
- TTccll__EEvvaall will process |
- comands from _c_m_d until |
- either it reaches a null |
- character or it |
- encounters a close |
- bracket that isn't |
- backslashed or enclosed |
- in braces, at which |
- point it will return; |
- newlines will treated as |
- white space, not as com- |
- mand separators. Under |
- normal conditions, _f_l_a_g_s |
- should be 0.
-
- char **_t_e_r_m_P_t_r (out) If _t_e_r_m_P_t_r is non-NULL, |
- TTccll__EEvvaall fills in |
- *_t_e_r_m_P_t_r with the |
- address of the character |
- just after the last one |
- in the last command |
-
-
-
- Sprite v.1.0 Printed: June 21, 1990 1
-
-
-
-
-
-
- Tcl_Eval Tcl Command Language Library Tcl_Eval
-
-
-
- successfully executed |
- (normally the null char- |
- acter at the end of |
- _c_m_d). If an error |
- occurs in the first com- |
- mand in _c_m_d, then |
- *_t_e_r_m_P_t_r will be set to |
- _c_m_d.
-
- _________________________________________________________________
-
-
- DDEESSCCRRIIPPTTIIOONN
- TTccll__EEvvaall parses commands from _c_m_d and executes them in order
- until either an error occurs or TTccll__EEvvaall reaches a terminat-
- ing character (']' or ' ', depending on the value of _f_l_a_g_s).
- The return value from TTccll__EEvvaall is one of the Tcl return
- codes TTCCLL__OOKK, TTCCLL__EERRRROORR, TTCCLL__RREETTUURRNN, TTCCLL__BBRREEAAKK, or
- TTCCLL__CCOONNTTIINNUUEE, and _i_n_t_e_r_p->_r_e_s_u_l_t will point to a string with
- additional information (result value or error message).
- This return information corresponds to the last command exe-
- cuted from _c_m_d.
-
- During the processing of a command it is legal to make
- nested calls to TTccll__EEvvaall (this is how conditionals, loops,
- and procedures are implemented). If a code other than
- TTCCLL__OOKK is returned from a nested TTccll__EEvvaall invocation, then
- the caller should normally return immediately, passing that
- same return code back to its caller, and so on until the
- top-level application is reached. A few commands, like ffoorr,
- will check for certain return codes, like TTCCLL__BBRREEAAKK and
- TTCCLL__CCOONNTTIINNUUEE, and process them specially without returning.
-
- TTccll__EEvvaall keeps track of how many nested Tcl_Eval invocations
- are in progress for _i_n_t_e_r_p. If a code of TTCCLL__RREETTUURRNN,
- TTCCLL__BBRREEAAKK, or TTCCLL__CCOONNTTIINNUUEE is about to be returned from the
- topmost TTccll__EEvvaall invocation for _i_n_t_e_r_p, then TTccll__EEvvaall con-
- verts the return code to TTCCLL__EERRRROORR and sets _i_n_t_e_r_p->_r_e_s_u_l_t
- to point to an error message indicating that the rreettuurrnn,
- bbrreeaakk, or ccoonnttiinnuuee command was invoked in an inappropriate
- place. This means that top-level applications should never
- see a return code from TTccll__EEvvaall other then TTCCLL__OOKK or
- TTCCLL__EERRRROORR.
-
-
- KKEEYYWWOORRDDSS
- command, execute, interpreter
-
-
-
-
-
-
-
-
-
-
- Sprite v.1.0 Printed: June 21, 1990 2
-
-
-
-